package edu.cs.usask.ca.silver.plugin.rcp.pages.preferences;

import org.eclipse.jface.preference.DirectoryFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

import edu.cs.usask.ca.silver.definitions.SystemProperties;
import edu.cs.usask.ca.silver.plugin.rcp.Activator;

public class AnylogicPreferencePage extends FieldEditorPreferencePage implements
		IWorkbenchPreferencePage {

	public AnylogicPreferencePage() {
		super(GRID);
	}

	@Override
	protected void createFieldEditors() {
		addField(new DirectoryFieldEditor("ANYLOGIC", "&Anylogic path:",
				getFieldEditorParent()));
	}

	public void init(IWorkbench workbench) {
		setPreferenceStore(Activator.getDefault().getPreferenceStore());
		if (SystemProperties.OS_NAME.startsWith("Windows"))
			setDescription("Please specify AnyLogic path (for example: C:\\Program Files\\AnyLogic 6):");
		else
			setDescription("Please specify AnyLogic path (for example: /Application/AnyLogic 6):");
		String dll = getPreferenceStore().getString("ANYLOGIC");
	}

}
